<?php
use Spatie\Permission\Models\Permission;
return [
    'title' =>  '权限',
    'heading' =>  '权限管理',
    'single' => '权限',
    'model' => Permission::class,
    'columns' => [
        'id' => [
            'title' => 'ID'
        ],
        'name' => [
            'title' => '权限名',
        ],
        'created_at',
        'operation' => [
            'title'  => '管理',
            'output' => function ($value, $model) {
                return $value;
            },
            'sortable' => false,
        ],
    ],
    'edit_fields' => [
        'name' => [
            'title' => '权限名',
            'type' => 'text',
        ],
        'roles' => [
            'type' => 'relationship',
            'title' => '角色',
            'name_field' => 'name',
        ],
    ],
    'filters' => [
        'id' => [
            'title' => 'ID',
        ],
        'name' => [
            'title' => '权限名',
        ],
    ],
    'rules' => [
        'name' => 'required',
    ],
    'messages' => [
        'name.required' => '权限名为必填项',
    ],
];
